//
//  InformationWebViewViewController.m
//  HarmonizePub
//
//  Created by Haven on 2016/11/22.
//  Copyright © 2016年 Zy. All rights reserved.
//

#import "InformationWebViewViewController.h"
#import "HealthyInfoList.h"
#import "Config.h"

@interface InformationWebViewViewController ()
@property (nonatomic, strong) UIWebView *webView;

@end

@implementation InformationWebViewViewController
// 懒加载webView
- (UIWebView *)webView
{
    if (_webView == nil) {
        _webView = [[UIWebView alloc] init];
    }
    return _webView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = self.healthyInfoList.title;
    
    // 加载WebView
    [self setupWebView];
    
}


// 加载webView
- (void)setupWebView
{
    self.view.backgroundColor = [UIColor lightGrayColor];
    
    self.webView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height - 64);
    
    [self.view addSubview:_webView];
    
    NSURL *url = nil;
    url = [URLTool imageURLStringWithPathString:[NSString stringWithFormat:@"%@", self.healthyInfoList.url]];
    
    NSURLRequest *request = [NSURLRequest requestWithURL: url];
    
    [_webView loadRequest:request];
}


@end
